function start(){
	$("#last").load("../footer.html #footer1");
	var myUserName = "myUserName";
	var myPwd = "myPwd"
	var isLogin = "isLogin";
	var isbuy = "isbuy";
	var goodMessage = "goodMessage";
	var userAddress = "userAddress";   //一个键名。表示收货人的地址
	var isHaveAddress = "isHaveAddress"; //一个键名，表示cookie中是否有收货地址
	var  totalPrices = "totalPrices";
	var orderNumber = "orderNumber";
	var paySrc = "paySrc";
	var orderGoods = "orderGoods"
	//判断用户是否登陆
	doesLogin();
	function doesLogin() {
		if (getCookie(isLogin) == 1) {
			$(".header-center-right").find("li").eq(0).find("a").html('欢迎您,' + getCookie(myUserName));
			$(".header-center-right").find("li").eq(1).find("a").html('|&nbsp;<a href="javascript:void(0)" id="cancel">退出</a>')
		} else {
			$(".header-center-right").find("li").eq(0).find("a").html('<a href="registerlogin/login.html">[请登录]</a>');
			$(".header-center-right").find("li").eq(1).find("a").html('<a href="registerlogin/register.html">[快速注册]</a>');
		}
		$("#cancel").on("click", function() {
			if (getCookie(isLogin) == 1) {
				updateCookie(isLogin, "0");
				window.location = "index.html"
			}
		})
	};
	//从新选择支付方式
	$(".way3>a").on("click",function(){
		modalDialog();
		$(".motai").show();
	});
	//模态部分
	function modalDialog(){
		$("html,body").css({"height":"100%","overflow":"hidden"})
		//确认收货信心

		//关闭模态窗口
		$(".modalClose").on("click",function(){
			$(this).parent().parent().parent().hide();
			$("html,body").css("overflow","none")
		});
	}

	//订单信息读取
	showAddress();
	function showAddress(){
		var addressNews = JSON.parse(getCookie(userAddress));
		console.log(addressNews)
		console.log(getCookie(paySrc))
		$(".pic").find("img").attr("src",getCookie(paySrc));
		$(".bianhao").html(getCookie(orderNumber))
		$(".addprise").html("￥"+getCookie(totalPrices))
		$(".address2").html(addressNews.name+'&nbsp;&nbsp;&nbsp;'+
					addressNews.address1+"&nbsp;"+addressNews.address2+"&nbsp;"+addressNews.address3+"&nbsp;"+
					addressNews.detailAddress+"&nbsp;&nbsp;联系电话&nbsp;"+addressNews.tell);
		
	};
	function edit(){
		$(".goods_address_list").on({"mouseenter":function(){
			$(this).find(".editaddress").show();
			$(".editaddress").on("click",function(){
				$(".motai").show();
			})
		},"mouseleave":function(){
			$(this).find(".editaddress").hide();
		}})
	};
	//支付方式
	payTab();
	function payTab(){
		for(var i=0; i<3; i++){
			$(".paycard>li").eq(i).css("left",i*85+"px")
		}
		$(".paycard>li").on("click",function(){
			var $index = $(this).index();
			$(this).addClass("active0").siblings().removeClass('active0');
			$(".paylist1").eq($index).show().siblings(".paylist1").hide();
		});
	};
	
}

$(function(){
	start();
})




//<input onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))">
